package com.xiaoqi.intentstudy;

import android.content.Intent;
import android.os.Bundle;
import android.widget.EditText;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

public class SencondActivity extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.second_activity);
        Intent intent = getIntent();
        String username = intent.getStringExtra("com.android.USERNAME");
        String password = intent.getStringExtra("com.android.PASSWORD");
        System.out.println(username);
        System.out.println(password);
        EditText user = findViewById(R.id.user);
        EditText pwd = findViewById(R.id.pwd);
        // 设置文本框内容
        user.setText(username);
        pwd.setText(password);
    }
}
